package com.xinruke.hostels.reservation.controller;

import com.xinruke.hostels.common.controller.BaseController;
import com.xinruke.hostels.common.vo.ResultVO;
import com.xinruke.hostels.common.vo.query.RowsDataVO;
import com.xinruke.hostels.reservation.interfaces.dto.*;
import com.xinruke.hostels.reservation.service.MeetingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @author GuoZheng
 * @ClassName MeetingController
 * @date：2019/6/19
 * @version: V1.0.0
 * @description：会议预订管理
 */
@RestController
@RequestMapping("/meeting/")
@Api(tags = "会议预订管理")
public class MeetingController extends BaseController {
    @Resource
    private MeetingService meetingService;

    @PostMapping("/submit")
    @ApiOperation("询价提交")
    public ResultVO submit(@Valid @RequestBody MeetingInquerySubmitInfoDto params) {
        return meetingService.submit(params);
    }


    /**
     * 询价单列表
     *
     * @return
     */
    @PostMapping("/list")
    @ApiOperation("会议询价列表")
    public ResultVO<RowsDataVO<MeetingInqueryListQueryResultDto>> list(@Valid @RequestBody MeetingInqueryListQueryDto params) {
        return meetingService.list(params);
    }


    /**
     * 询价单列表
     *
     * @return
     */
    @PostMapping("/detail")
    @ApiOperation("询价单详情")
    public ResultVO<MeetingInqueryDetailResultDto> orderDetail(@Valid @RequestBody MeetingInqueryDetailQueryDto params) {
        return meetingService.detail(params);
    }


    /**
     * 确认询价单
     *
     * @return
     */
    @PostMapping("/verify")
    @ApiOperation("确认询价单")
    public ResultVO verify(@Valid @RequestBody MeetingVerifyQueryDTO params) {
        return meetingService.verify(params);
    }

}
